﻿@using PagedList.Mvc;
@using PagedList;
@model PagedList.IPagedList<WineStore.Models.Sim>
@{
    ViewBag.Title = "ResultAdvanceSearch";
    Layout = "~/Views/Shared/HomeLayout.cshtml";
}

@*<script src="../../Scripts/jquery-1.4.4.min.js"></script>
<script type="text/javascript">
    $(function () {
        /* For zebra striping */
        $("table tr:nth-child(odd)").addClass("odd-row");
        /* For cell text alignment */
        $("table td:first-child, table th:first-child").addClass("first");
        /* For removing the last border */
        $("table td:last-child, table th:last-child").addClass("last");
    });
</script>*@
<!--Sử dụng chung-->
<script src="../../Scripts/jquery-1.5.1.min.js"></script>
<!--Sử dụng cho autocomplete-->
    <script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>

<!--Sử dụng cho autocomplete-->
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            $('*[data-autocomplete-url]')
        .each(function () {
            $(this).autocomplete({
                source: $(this).data("autocomplete-url")
            });
        });
        });
    </script>


<!--Sử dụng cho autocomplete-->
<link href="../../Content/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<link href="../../Content/styletablesim.css" rel="stylesheet" />
<!--Sử dụng cho paging-->
<link href="../../Content/PagedList.css" rel="stylesheet" type="text/css" />

<link href="../../Content/styleorderform.css" rel="stylesheet" />

<div class="center_title_bar"><img style="position:relative; top:3px;" src="../../Content/Images/Home/down_gray.png"/> Tìm sim theo yêu cầu</div>

<div class="prod_box_big">
   
            <div id="addresspayment">
                @using (Html.BeginForm("ResultAdvanceSearch", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
                {
                    <div class="checkboxFive">
                        <input type="checkbox" value="1" id="checkboxFiveInput" name="" class="abc" />
                        <label for="checkboxFiveInput"></label>
                    </div>
                    <span style="position: relative; top: -15px; left: 70px; font-style: italic; font-size: 13px;">Bạn hãy nhập thông tin vào biểu mẫu dưới đây và nhấn Tìm Kiếm</span>               
                    <div>
                        <div style="position: relative; left: 33px;">Tên nhà mạng @Html.TextBox("SearchString1", ViewBag.CurrentFilter1 as string, new { data_autocomplete_url = Url.Action("Autocomplete"), @class="input"})</div>
                        <div style="position: relative; left: 33px; margin-top:5px;">Tên nhóm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;      @Html.TextBox("SearchString2", ViewBag.CurrentFilter2 as string, new { data_autocomplete_url = Url.Action("AutocompleteCategory"), @class="input"})</div>
                        <div style="position: relative; left: 33px; margin-top:5px;">Giá sim từ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;       @Html.TextBox("SearchString3", ViewBag.CurrentFilter3 as string, new {@class="input"})</div>
                        <div style="position: relative; left: 33px; margin-top:5px;">Giá sim đến&nbsp;&nbsp;&nbsp;       @Html.TextBox("SearchString4", ViewBag.CurrentFilter4 as string, new {@class="input"})</div>
                        <div style="position: relative; left: 33px; margin-top:5px;">Số sim&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;       @Html.TextBox("SearchString5", ViewBag.CurrentFilter5 as string, new {@class="input"})</div>
                        <input type="submit" value="Tìm kiếm" class="submit" style="position: relative; left: 120px; margin-top:7px;" />
                    </div>    
                }
            </div>
       
</div>
<div style="clear:both;"></div>
<div id="content">

    <table cellspacing="0">
        <tr>
            <th>Mã Số</th>
            <th>Sim</th>
            <th>Giá</th>
            <th>Mạng</th>
            <th>Nhóm</th>
            <th>Đặt Mua</th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>@item.SimId</td>
                <td><a class="simnumber" href="../../Home/Order?id=@item.SimId">@item.SimNumber</a></td>
                <td style="color: #CC0000; font-weight: bold;">@item.SimPrice đ</td>
                <td><img src="../../Content/Images/Supplier/@item.Supplier.SupplierImage" width="70" height="21"/></td>
                <td style="color: #006666; font-weight: bold;">@item.CategorySim.CategorySimName</td>
                <td><a class="edit" href="../../Home/Order?id=@item.SimId">Đặt Mua</a></td>
            </tr>
        }

        <tr style="height: 25px;">
            <td colspan="10" style="padding: 0px;">
                <div style="position: relative; top: -10px; left: -30px;">
                    @Html.PagedListPager(Model, page => Url.Action("ResultAdvanceSearch", new { page = page, currentFilter1 = ViewBag.CurrentFilter1, currentFilter2 = ViewBag.CurrentFilter2,  currentFilter3 = ViewBag.CurrentFilter3,currentFilter4 = ViewBag.CurrentFilter4,currentFilter5 = ViewBag.CurrentFilter5 }), (PagedListRenderOptions)ViewBag.Pro)
                </div>
            </td>
        </tr>
    </table>
</div>

